import { MouseAction, MouseActionTypes } from '../actions/mouse.action';
import { MousePosition } from '../../models';

export const initialMouseState: MousePosition = {
    lat: 0,
    lng: 0
};

export function MouseReducer(state: MousePosition = initialMouseState, action: MouseAction): MousePosition {
    switch(action.type) {
        case MouseActionTypes.MOUSE_POSITION: {
            return action.payload;
        }
        default: {
            return state;
        }
    }
}